<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
	language="java"%>
<%@ include file="/jsp/platform/include/include.jsp"%>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<TITLE><c:out value="${_LOGONUSER_.MANAGETITILE}" />
</TITLE>

	<%@ include file="/jsp/platform/include/header.jsp"%>
</HEAD>
<BODY>
	<DIV class="all">
		<%@ include file="/jsp/platform/include/head.jsp"%>
		<%@ include file="/jsp/platform/include/menu.jsp"%>
		<DIV class="mains">
			<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
				<TBODY>
					<TR valign="top">
						<%@ include file="/jsp/platform/include/mainLeft.jsp"%>
						<TD>
							<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
								<TBODY>
									<TR>
										<TD>
											<TABLE width="180" border="0" cellspacing="0" cellpadding="0">
												<TBODY>
													<TR>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_l.jpg">
														</TD>
														<TD align="center"
															background="<%=request.getContextPath()%>/images/pages_bg.jpg">
															<SPAN class="f_tit1">密码修改</SPAN>
														</TD>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_r.jpg">
														</TD>
													</TR>
												</TBODY>
											</TABLE>
										</TD>
									</TR>
								</TBODY>
								<TR>
									<TD>
										<div class="pages_con">
											<div class="pages_con_20">
												<FORM name="passwordForm" id="passwordForm"
													action="<%=request.getContextPath()%>/manage/user/updateUserPassword"
													method="post">
													<div class="transaction_external">
														<div class="clearfix">
															<span class="label cz_label "
																style="width:120px;text-align:right;">&nbsp;原密码：</span> <input
																name="oldPassword"
																class="txtbox_cz txtbox_cz_color input_change"
																id="oldPassword" type="password">
														</div>
														<div class="clearfix">
															<span class="label cz_label "
																style="width:120px;text-align:right;">新密码：</span> <input
																name="newPassword"
																class="txtbox_cz txtbox_cz_color input_change"
																id="newPassword" type="password">
														</div>
														<div class="clearfix">
															<span class="label cz_label "
																style="width:120px;text-align:right;">确认密码：</span> <input
																name="newPasswordConfirm"
																class="txtbox_cz txtbox_cz_color input_change"
																id="link_telephone" type="password">
														</div>
														<div class="note">
															<span class="label cz_label">&nbsp;</span> <A
																class="btn confirm" href="javascript:void(0);"
																onclick="javaScript:summitPasswordForm()"
																style="margin-left:114px;">确认</A><A class="btn confirm"
																onclick="javaScript:resetForm()"
																href="javascript:void(0);">重置</A>
														</DIV>
													</DIV>
												</FORM>
											</div>
										</div> <!--当中内容块结束-->
									</TD>
								</TR>
							</TABLE>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
		</DIV>
		<%@ include file="/jsp/platform/include/foot.jsp"%>
		<script type="text/javascript">
		    function resetForm(){
		    		document.passwordForm.reset();
		    }
			function summitPasswordForm() {
				var oldPassword = $('#passwordForm').find("[name=oldPassword]")
						.val();
				var newPassword = $('#passwordForm').find("[name=newPassword]")
						.val();
				var newPasswordConfirm = $('#passwordForm').find(
						"[name=newPasswordConfirm]").val();
				if ($.trim(oldPassword) == '') {
					$.messager.alert("提示信息", "原密码不能为空");
					return false;
				}
				if ($.trim(newPassword) == '') {
					$.messager.alert("提示信息", "新密码不能为空");
					return false;
				}
				if ($.trim(newPasswordConfirm) == '') {
					$.messager.alert("提示信息", "确认新密码不能为空");
					return false;
				}
				if (newPasswordConfirm == newPassword) {
				    var oldPassword = $("#oldPassword").val();
				    var newPassword = $("#newPassword").val();
					var url = "<%=request.getContextPath()%>/manage/operatorInfo/modifyPassword?oldPassword="
							+ oldPassword + "&newPassword=" + newPassword;
					$
							.ajax({
								async : false,
								type : "POST",
								url : url,
								dataType : 'json',
								success : function(json) {
									if (json.state == "a_1") {
										$.messager
												.alert(
														"提示信息",
														"修改登录密码成功",
														"info",
														function() {
															window.location.href = window.location.href;
														});
									} else if (json.state == "a_0") {
										$.messager
												.alert(
														"提示信息",
														"原登录密码不正确",
														"info",
														function() {
															window.location.href = window.location.href;
														});
									} else if (json.state == "0") {
										$.messager
												.alert(
														"提示信息",
														"修改失败,请联系管理员",
														"info",
														function() {
															window.location.href = window.location.href;
														});
									}
								}
							});
				} else {
					$.messager.alert("提示信息", "新密码和确认密码不同，请重复输入！");
					return false;
				}
			}
		</script>
</BODY>
</HTML>
